January 17, 2018
linear \(\Rightarrow\) non-linear
additive \(\Rightarrow\) interactions
theory-driven \(\Rightarrow\) optimization-driven
A startup wants you to predict wine quality from its chemical composition.
Free online dataset about red and white variants of the Portuguese “Vinho Verde” wine.
Target: Quality from 1 to 10 Features: Acidity, alcohol …
P. Cortez, A. Cerdeira, F. Almeida, T. Matos and J. Reis. Modeling wine preferences by data mining from physicochemical properties. In Decision Support Systems, Elsevier, 47(4):547-553, 2009.
TODO: Draw image with features.
1 - fixed acidity 2 - volatile acidity 3 - citric acid 4 - residual sugar 5 - chlorides 6 - free sulfur dioxide 7 - total sulfur dioxide 8 - density 9 - pH 10 - sulphates 11 - alcohol Output variable (based on sensory data): 12 - quality (score between 0 and 10)
Draw: Volatile acidity as polish remover, pH as pH paper, alchohol as liqour bottle, chlorides as salt prinkler, citric acid as lemon, sulfur as mushroom?,
10x CV Test linear regression model, decision tree, random forest
| learner.id | mae.test.mean |
|---|---|
| regr.ranger | 0.4353923 |
| regr.lm | 0.5696394 |
| regr.rpart | 0.6015873 |
=> The random forest (ranger) is the best model.
Client: “We would love to learn some insights.”
Looking inside the black box
A customer gets a really bad prediction. What was the reason?
| 5589 | |
|---|---|
| type | red |
| fixed.acidity | 7.4 |
| volatile.acidity | 1.185 |
| citric.acid | 0 |
| residual.sugar | 4.25 |
| chlorides | 0.097 |
| free.sulfur.dioxide | 5 |
| total.sulfur.dioxide | 14 |
| density | 0.9966 |
| pH | 3.63 |
| sulphates | 0.54 |
| alcohol | 10.7 |
| quality | 3 |
## [1] 3.7628
| 877 | |
|---|---|
| type | white |
| fixed.acidity | 6.9 |
| volatile.acidity | 0.36 |
| citric.acid | 0.34 |
| residual.sugar | 4.2 |
| chlorides | 0.018 |
| free.sulfur.dioxide | 57 |
| total.sulfur.dioxide | 119 |
| density | 0.9898 |
| pH | 3.28 |
| sulphates | 0.36 |
| alcohol | 12.7 |
| quality | 9 |
## [1] 8.124267
Technique: Shapley Values
IF \(90m^2\leq \text{size} < 110m^2\) AND location \(=\) “good” THEN rent is between 1540 and 1890 EUR
TODO: Example for CNNs
TODO: Example for text (RNNs and attention?)
TODO: PDP gif
TODO: Feature importance figure
TODO: Graphic for counterfactuals
TODO: Graphic for prototypes
More on interpretable machine learning in my book http://christophm.github.io/interpretable-ml-book/.